package com.white.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.white.bean.SignIn;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SignInMapper extends BaseMapper<SignIn> {
    String TABLE_NAME = " SignIn ";

    @Insert("insert" + TABLE_NAME + "(userId) values(#{userId})")
    void create(long userId);

    @Select("select * from " + TABLE_NAME + " where userId = ${userId} order by createTime desc")
    List<SignIn> searchByUserId(long userId);
}
